package ai.people.core.common.properties.sources;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.Set;

/**
 * 钱包集
 *
 * @author zhenglin
 * @date 2022/5/9 14:30
 */
@Component
@ConfigurationProperties("nm.wallets")
public class Wallets {

    /**
     * 信源集合
     */
    private static Set<String> nameSet;


    public void setNameSet(Set<String> sourceSet) {
        Wallets.nameSet = sourceSet;
    }

    /**
     * 获取源
     *
     * @return {@link Set}<{@link String}>
     */
    public static Set<String> getSourceSet(){
        return nameSet;
    }

    /**
     * 包含
     *
     * @param sourceName 源名称
     * @return boolean
     */
    public static boolean contains(String sourceName){
        return nameSet.contains(sourceName);
    }

}
